package job.work.mapper.system;

import job.work.domain.system.entity.pojo.DecRole;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Optional;


public interface RoleMapper extends Mapper<DecRole> {

    @Select("select * from dec_role where id = #{id}")
    Optional<DecRole> findByRoleId(Long id);

    @Select("select * from dec_role where name = #{name}")
    DecRole findByName(String name);

    @Select("select * from dec_role where type = #{type}")
    List<DecRole> findByType(int type);

    @Select("select * from dec_role where status = #{status}")
    List<DecRole> findByStatus(@Param("status") int status);

}